package com.lanyou.esb.cook.proxy.meta;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 存储转发状态 <br>
 * 描述：<br>
 * 1：转发失败；2：转发成功；3：进行中；
 * 
 * @author Davey.wu
 */
public enum StoreForwardStatus {
	//
	FAILURE("1"), SUCCESS("2"), PROGRESS("3");

	public static final String TypeCode = "20015";

	public final String ValueCode;

	private StoreForwardStatus(String code) {
		this.ValueCode = code;
	}

	public static StoreForwardStatus get(String valueCode)
			throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (StoreForwardStatus type : StoreForwardStatus.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
